package cn.kgc.client;

import cn.kgc.entity.Score;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author: 课工场
 * @Version: v1.0  2023/6/28
 * @Description:
 * ScoreClient scoreClient
 *     scoreClient.getById()   http://192.168.1.2:8503/score/getById
 *     http://192.168.1.2:8503/score/getById?id=10
 *     http://192.168.1.2:8503/score/getById/10
 */
@FeignClient("SCORE")
public interface ScoreClient {


    //http://192.168.1.2:8503/score/getById?id=10
    @RequestMapping("/score/getById")
    String getById(@RequestParam("id") Integer id);


    @RequestMapping("/score/getById2/{id}")
    String getById2(@PathVariable("id") Integer id);

    @RequestMapping("/score/add")
    String addScore(@RequestBody Score score);

     @RequestMapping("/score/select")
     Score selectByCourseName(@RequestParam("name") String name);
}
